
public class EXE_MEM {
	int RegWE;
	int DestReg;
	int AccMem;
	int MemData;
	int MemWE;
	int AddMem;
	int ALU_Out;
	
	int keep;
	
	int swRegSrc; 
	
	private int PC;
	
	void init(){
		keep=0;
		PC=-4;
	}
	
	void set_RegWE(int regwe){
		if(keep==0)
			RegWE=regwe;
	}
	int get_RegWe(){
		return RegWE;
	}
	void set_DestReg(int destreg){
		if(keep==0)
			DestReg=destreg;
	}
	int get_DestReg(){
		return DestReg;
	}
	void set_AccMem(int regwe){
		if(keep==0)
			AccMem=regwe;
	}
	int get_AccMem(){
		return AccMem;
	}
	void set_MemData(int regwe){
		if(keep==0)
			MemData=regwe;
	}
	int get_MemData(){
		return MemData;
	}
	void set_MemWE(int regwe){
		if(keep==0)
			MemWE=regwe;
	}
	int get_MemWE(){
		return MemWE;
	}
	void set_AddMem(int regwe){
		if(keep==0)
			AddMem=regwe;
	}
	int get_AddMem(){
		return AddMem;
	}
	void set_ALU_Out(int regwe){
		if(keep==0)
			ALU_Out=regwe;
	}
	int get_ALU_Out(){
		return ALU_Out;
	}	
	void set_swRegSrc(int regwe){
		if(keep==0)
			swRegSrc=regwe;
	}
	int get_swRegSrc(){
		return swRegSrc;
	}
	
	void setPC(int pc){
		if(pc==-1)
			this.clear();
		this.PC=pc;
	}
	
	int getPC(){
		return this.PC;
	}
	
	void clear(){
		RegWE=0;
		DestReg=0;
		AccMem=0;
		MemData=0;
		MemWE=0;
		AddMem=0;
		ALU_Out=0;
		
		keep=0;
		
		swRegSrc=0; 
		
	}
}
